home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / clipper / ks94an.zip / XOR.HDR < prev    next >
Text File  |  1994-04-25  |  1KB  |  43 lines

  1. /******************************************************************************
  2.                  The Klipper Library, for CA-Clipper 5.x
  3.         Copyright (c), 1994, Wallace Information Systems Engineering
  4.  
  5. FUNCTION:
  6.  
  7. _XOR( nData, nKey ) --> nInteger
  8.  
  9. PARAMETERS:
  10.  
  11. nData  : Binary Number to XOR with nKEY
  12. nKey   : Binary Number to XOR with nData
  13.  
  14. SHORT:
  15.  
  16. Perform a binary Exclusive OR with binary INTEGERS.
  17.  
  18. DESCRIPTION:
  19.  
  20. _XOR() performs a bitwise XOR or two binary numbers. The two numbers
  21. are padded to the same number of positions (to a maximum of 8 digits)
  22. before the operation takes place in order to retain positional values:
  23.  
  24. 100101 XOR 101    becomes    100101 XOR 000101
  25.  
  26. NOTE:
  27.  
  28.  
  29.  
  30. EXAMPLE:
  31.  
  32. t = _XOR(1011,11)
  33.  
  34. original 1011    Both params are padded to eight places 00001010
  35. key      11                                             00000011
  36.                                                         --------
  37.                                           Result:       00001001
  38.  
  39.  
  40. Result: t = 1001 (leading zeros ignored in RETURN())
  41.  
  42. ******************************************************************************/
  43.